/**
 *
 */
package br.com.werp.regras.rh.visao.decorador;

import br.com.werp.regras.geral.helpers.SetorHelper;
import br.com.werp.regras.geral.util.Dia;
import br.com.werp.regras.geral.util.FormatDate;
import br.com.werp.regras.geral.util.Html;
import br.com.werp.regras.geral.vos.tabelas.Noticia;
import br.com.werp.regras.geral.vos.tabelas.Setor;

import org.displaytag.decorator.TableDecorator;

import java.util.HashMap;
import java.util.Map;


/**
 * @author Italo
 *
 *10/07/2006
 */
public class PesquisaNoticias extends TableDecorator {
   
	public String getNoti_id() {
        Noticia noticia = (Noticia) getCurrentRowObject();

        Map map = new HashMap();
        map.put("noti_id", String.valueOf(noticia.getNoti_id()));
        map.put("carregar_action", "");

        return Html.href("../Intranet/AvisosForm.do", map) +
        noticia.getNoti_id() + "</a>";
    }

    public String getNoti_setor() throws Exception {
        Noticia noticia = (Noticia) getCurrentRowObject();

        Setor setor = SetorHelper.obterSetorPorId(noticia.getNoti_setor());

        return setor.getStor_descricao();
    }

    public String getNoti_data() {
        Noticia noticia = (Noticia) getCurrentRowObject();

        return new Dia(noticia.getNoti_data()).toString();
    }

    public String getNoti_usuario() {
        Noticia noticia = (Noticia) getCurrentRowObject();

        return noticia.getNoti_usuario();
    }

    public String getNoti_descricao() {
        Noticia noticia = (Noticia) getCurrentRowObject();

        return noticia.getNoti_descricao();
    }
}
